<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/rp/common/taglib.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>">
    
    <title>导入数据</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	
	<script src="rp/scripts/boot.js" type="text/javascript"></script>
	
	<style type="text/css">
	   	
    </style>
	
  </head>
  
  <body class="body-p5">
  	
  	<textarea id="myTextarea" class="mini-textarea" value="" 
  		style="width: 100%; height: 250px; margin-bottom: 5px;" emptyText="请填入需要导入的数据"></textarea>

  	<a class="mini-button" onclick="importData()"><i class="fa fa-sign-in fa-lg"></i> 导入数据</a>
  	
	<script type="text/javascript">
		var $text;
		var importUrl;
		
		$(function(){
			mini.parse();
			$text = mini.get("myTextarea");
		});
		
		function initImportUrl(_url){
			importUrl = _url;
		}

		function importData(){
			var content = $text.getValue();
			rp_ajax(importUrl, {json: content}, function(result){
				if(result == "success"){
					mini.alert("导入成功");
				}
			});
		}
	</script>
  </body>
</html>
